﻿using UnityEngine;
using UnityEngine.UI;

class OperateLogic_1 :MonoBehaviour
{
    [SerializeField]private Button btn1;

    private bool startTestOp1 = false;
    void Start()
    {
        btn1.onClick.AddListener(() => 
        {
            startTestOp1 = !startTestOp1;

            Debug.LogError($"excute time = {Time.time}");
        });
    }

    private int offen = 1;
    private void Update()
    {
        if (!startTestOp1)
            return;

        offen++;
        if (offen % 5 == 0)
            SyncClient1.SyncObj.SyncOperate(OperateData1.Create(DemoMathf.GetVec()));
        if (offen % 9 == 0)
            SyncClient1.SyncObj.SyncOperate(OperateData2.Create(DemoMathf.GetVec()));
    }
}

